<html>
<title><?echo $username?> - Live Support for website</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<LINK href="styles/main.css" type=text/css rel=stylesheet>
<body leftmargin="0" topmargin="0">
<br /><br />
<table width="600" border="0" cellspacing="5" cellpadding="2" style="background:#EEF5FE; border:1px solid #6888DE" align="center">
 <tr>
 	<td align="center" colspan="2" style="color:#FF0000">
		List Room<br>
		<?echo $alert?>
	</td>
 </tr>
 <tr>
 	<td colspan="2">
		<table width="100%" bgcolor="#215582" cellpadding="1" cellspacing="1">
		<tr style="background:#3366CC;">
			<td class="texth">User name</td>
			<td class="texth">Room Name</td>
			<td class="texth">Actions</td>
		</tr>
		<?
		foreach($listrooms as $i=> $room)
		{
		?>
		<tr style="background:#fff">
			<td class=""><?echo $room['cUserName']?> <?if($room['iParentId']==0)echo "(root)"?></td>
			<td class=""><?echo $room['cRoomName']?></td>
			<td class="">
				<a href="?opt=editroom&id=<?echo $room['iUserId']?>">Edit</a> - 
				<?
				if($room['iParentId']>0)
				{
				?>
				<a href='#Delete' 
				onclick="if(confirm('Do you want delete?')) location = '?opt=delroom&id=<?echo $room['iUserId']?>'">Delete</a>	<?
				}
				?>
			</td>
		</tr>
		<?
		}
		?>
		</table>		
	</td>
 </tr>
  <tr>
 	<td></td>
	<td>			
		<input type="button" value="Add Room" style="width:80" onClick="location='?opt=addroom'"/>	
		<input type="button" value="Back" style="width:80" onClick="location.href='index.php'"/>	
		</td>
 </tr>
</table>
</body>
</html>